<template>
  <div class="lostList">
    <div class="listMessage" v-for="(item, i) in lostList" :key="i" @click="detail(item.no)">
      <div class="tital">
        <span class="name">{{ item.lostName }}</span>
        <span class="date">
          {{ item.date }}
        </span>
      </div>
      <div class="des">
        <span>{{ item.description }}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { getLostList } from "@/api/api.js";

export default {
  data: function () {
    return {
      lostList: [],
    };
  },
  methods: {
    //   getNum:function(item){
    //       console.log(item.no);
    //   }
    detail:async function(no){
      // console.log(no);
      this.$router.push({ name: "detail", params: { no: no } });
    }
  },
  mounted: async function () {
    let result = await getLostList();
    // console.log(result);
    this.lostList = result.data.lostList;
    // console.log(this.lostList);
  },
};
</script>

<style lang="less" scoped>
.lostList {
  min-width: 7.5rem;
  min-height: 100vh;
  background-color: #f5f6fa;
  display: flex;
  flex-direction: column;
  align-items: center;
  .listMessage {
    letter-spacing:0.03rem;
    text-align:justify;
    width: 6rem;
    // height: 2rem;
    border-radius: 0.4rem;
    box-shadow: 0rem 0rem 0.1rem 0rem rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    background-color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    &:last-of-type {
      margin-bottom: 1.8rem;
    }
    .tital {
      width: 5.5rem;
      color: #192a56;
      padding: 0.25rem 0.2rem 0.2rem 0.2rem;
      border-bottom: solid 0.01rem #7f8fa6;
      display: flex;
      justify-content: space-between;
      align-items: center;
      span {
        height: 0.4rem;
        &:first-child {
          font-weight: 700;
        }
      }
      .name {
        font-size: 0.4rem;
        line-height: 0.4rem;
      }
      .date {
        font-size: 0.28rem;
        line-height: 0.4rem;
      }
    }
    .des {
      width: 6rem;
      font-size: 0.35rem;
      color: #273c75;
      padding: 0.2rem 0.4rem 0.3rem 0.4rem;
    }
  }
}
</style>